<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>店铺信息 - 红高粱</title>
<%@ include file="/WEB-INF/jsp/common/res.jsp"%>
<style type="text/css">
#_category{background-color:#0087d8;} 
</style>
</head>
<body>
<%@include file="/WEB-INF/jsp/common/header.jsp" %>
<div class="main">
	<div class="main_title">
		<div class="main_title2"><span>当前位置：店铺管理 &gt; 店铺信息</span></div>
	</div>
	<div class="main_content">
		<div class="main_menu">
				<ul>
					<li class="choice">
						<a href="<c:url value="/categorym/query"/>" style="color:#FFFFFF;">店铺信息</a>
					</li>
					<li><a href="<c:url value="/categorym/add"/>">添加店铺</a></li>
				</ul>
		</div>
		<div class="main_list">
<!-- 			<div class="title"> -->
<!-- 			 	产品信息 -->
<!-- 			</div> -->
			<table  width="98%" border="0" cellspacing="0" cellpadding="0" class="dataTable">
				<thead>
		              <tr>
		                <th  style="border-left: 1px solid #ccc;">店名</th>
		                <th >封面图片</th>
		                <th >地址</th>
						<th >电话</th>
						<th >登陆ID</th>
						<th >用户名</th>
		                <th >操作</th>
		              </tr>
		        </thead>
		        <tbody>
		              <c:forEach var="p" items="${categories}" varStatus="var">
			              <tr <c:if test="${var.index%2 eq 0}">style="background-color:#F4F4F4"</c:if> style="height: 50px;">
			              	<td style="border-left:1px solid #ccc;">${p.name}</td>
			              	<td style="width: 120px;">
			              		<img src="${p.images}" style="width:100px;height:50px;padding: 5px;"/>
			              	</td>
			              	<td>${p.address}</td>
							<td style="width:40px;">${p.phone }</td>
							<td style="width:80px;">${p.loginId }</td>
							<td style="width:120px;">${p.uname }</td>
			              	<td style="border-right:1px solid #ccc;">
			              		<a href="<c:url value="/categorym/edit/${p.id}"/>">[修改]</a>&nbsp;&nbsp;
			              		<a href="<c:url value="/updatePwd?tLoginId=${p.loginId}"/>">[修改密码]</a>&nbsp;&nbsp;
			              		<a href="<c:url value="/categorym/editSubCategory/${p.id}"/>">[分类管理]</a>&nbsp;&nbsp;
			              		<a href="javascript:del(${p.id})">[删除]</a>
			              	</td>
			              </tr>	
		              </c:forEach>
		       </tbody>
		       </table>
		       <div class="bottom_page">
		       		<c:if test="${len lt 1}">
						<p style="text-align: center; font-size:14px;">对不起，没有符合条件的信息</p>
					</c:if>
					<c:if test="${len gt 0}">
					    <p>
						<c:if test="${page eq 1}">
								<a href="javascript:" style="color: #ccc;">首页</a>&nbsp;
								<a href="javascript:" style="color: #ccc;">上一页</a>
						</c:if>
						<c:if test="${page gt 1}">
								<a href="<c:url value="/product/query"/>">首页</a>&nbsp;
								<a href="<c:url value="/product/query?page=${page -1}"/>">上一页</a>
						</c:if>
						<c:if test="${page lt pageTotal}">
								<a href="<c:url value="/product/query?page=${page +1}"/>">下一页</a>&nbsp;
								<a href="<c:url value="/product/query?page=${pageTotal}"/>">尾页</a>
						</c:if>
						<c:if test="${page >= pageTotal}">
								<a href="javascript:" style="color: #ccc;">下一页</a>&nbsp;
								<a href="javascript:" style="color: #ccc;">尾页</a>
						</c:if>
						&nbsp;&nbsp;
						<span style="color:#ccc;font-size: 12px;">当前第${page}页/共${pageTotal}页/共${total}条记录</span>	
						</p>	
					</c:if>
		       </div>
		</div>
	</div>
</div>
<script type="text/javascript">
//删除产品
function del(id){
	if(confirm("是否删除?")){
		window.location.href="<c:url value="/categorym/delete"/>/"+id;
	}
}
</script>
</body>
</html>